package com.cssw.fyzb.wap.service;

import com.cssw.fyzb.base.web.domain.AjaxPage;
import com.cssw.fyzb.wap.model.vo.NotifyVo;
import com.ydn.appserver.MinaAppClient;
import com.ydn.appserver.Request;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author Jian Qin.
 */
@Service
public class ImMessageService extends BaseService{
    @Autowired
    private MinaAppClient busiClient;

    public AjaxPage<NotifyVo> listAt(Long userId, int pageNumber, int pageSize) {
        Request request = new Request("ListAt");
        request.setParameter("userId", userId);
        request.setParameter("pageNumber", pageNumber);
        request.setParameter("pageSize", pageSize);
        return convertPage(busiClient.send(request), NotifyVo.class);
    }

    public AjaxPage<NotifyVo> listComment(Long userId, int pageNumber, int pageSize) {
        Request request = new Request("ListComment");
        request.setParameter("userId", userId);
        request.setParameter("pageNumber", pageNumber);
        request.setParameter("pageSize", pageSize);
        return convertPage(busiClient.send(request), NotifyVo.class);
    }

    public AjaxPage<NotifyVo> listLike(Long userId, int pageNumber, int pageSize) {
        Request request = new Request("ListLike");
        request.setParameter("userId", userId);
        request.setParameter("pageNumber", pageNumber);
        request.setParameter("pageSize", pageSize);
        return convertPage(busiClient.send(request), NotifyVo.class);
    }

    public AjaxPage<NotifyVo> listFocus(Long userId, int pageNumber, int pageSize) {
        Request request = new Request("ListFocus");
        request.setParameter("userId", userId);
        request.setParameter("pageNumber", pageNumber);
        request.setParameter("pageSize", pageSize);
        return convertPage(busiClient.send(request), NotifyVo.class);
    }
}
